require.config(require_config);

define([
    'jquery',
    'common',
    'ready',
    'template',
    'collection',
    'model'
], function($, common, ready, template, Collection, Model) {

    var index = function() {
        this.init();
    };

    index.prototype = {
        init: function() {
            loading();
            this.event();
            this.fetch();
        },

        fetch: function() {
            var _this = this;
            this.collection = new Collection({
                container: 'data-list',
                template: 'data-item',
                url: _global.url.api + 'user/money/log',
                condition: {
                    limit: 10,
                    offset: 0,
                    user_id: _global.params.user_id
                },
                callback: function() {
                    $('#username').html(this.result.username);
                    loaded();
                }
            });
            this.collection.fetch();
        },

        event: function() {}
    };

    new index();

});